<?php
/**
 * Short description for file
 *
 * Long description for file (if any)...
 *
 * LICENSE: LGPL
 *
 * @category   Sabai
 * @package    Sabai_User
 * @copyright  Copyright (c) 2006 myWeb Japan (http://www.myweb.ne.jp/)
 * @license    http://opensource.org/licenses/lgpl-license.php GNU LGPL
 * @version    CVS: $Id: IdentityFetcher.php 168 2008-03-11 19:13:33Z mikhail.miguel $
 * @link
 * @since      File available since Release 0.1.1
*/

/**
 * Short description for class
 *
 * Long description for class (if any)...
 *
 * @category   Sabai
 * @package    Sabai_User
 * @copyright  Copyright (c) 2006 myWeb Japan (http://www.myweb.ne.jp/)
 * @author     Kazumi Ono <onokazu@gmail.com>
 * @license    http://opensource.org/licenses/lgpl-license.php GNU LGPL
 * @version    CVS: $Id: IdentityFetcher.php 168 2008-03-11 19:13:33Z mikhail.miguel $
 * @link
 * @since      Class available since Release 0.1.1
 * @abstract
 */
class Sabai_User_IdentityFetcher
{
    /**
     * Fetch user identity objects
     *
     * @param array $userids
     * @return array array of Sabai_User_Identity objects indexed by user id
     */
    function fetchIdentities($userids)
    {
        static $users = array();
        // only fetch that are not already fetched
        if ($userids = array_diff($userids, array_keys($users))) {
            $users = $users + $this->_doFetchIdentities($userids);
        }
        return $users;
    }

    /**
     * Fetch user identity objects
     *
     * @abstract
     * @param array $userids
     * @return array array of Sabai_User_Identity objects indexed by user id
     */
    function _doFetchIdentities($userids){}
}